extends "../baerdimo-3/baerdimo-3.gd"


var baseId = ""
var upText1 = "护盾充能转化系数+10%"
var upText2 = "护盾同化吸收系数+10%"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("每{cd}秒吸收全场单位的15%护盾为己用(优先吸收敌人的，会受承疗效果影响)", "护盾同化", "shieldAssimilation", 8)

func _castCdSkill(id):
	._castCdSkill(id)
	if id=="shieldAssimilation":
		shieldAssimilation()

func shieldAssimilation():
	for i in getAllChas(1):
		if shield >= shieldLimit:return
		var s = i.get("shield") * p4
		if team == 2:
			s *= 0.5
		changeShield(s)
		i.changeShield(-s)
	for i in getAllChas(2):
		if shield >= shieldLimit:return
		var s = i.get("shield") * p4
		changeShield(s)
		i.changeShield(-s)
var p4 = 0.15
func upgrade():
	.upgrade()
	if upgraded == 1:
		p2 = 0.4
	if upgraded == 2:
		p4 = 0.25